package com.app.teaware.bean;


import com.alibaba.fastjson.annotation.JSONField;

import java.util.ArrayList;

public class    StockListBean extends BaseListBean {

    private ArrayList<StockListData> list = new ArrayList<StockListData>();

    public ArrayList<StockListData> getList() {
        return list;
    }

    public void setList(ArrayList<StockListData> list) {
        this.list = list;
    }

    @JSONField(serialize = false)
    public void addListBean(StockListBean listbean) {
        if (listbean == null)
            return;
        if (this.getCurrentPage() == INIT_PAGE) {
            setList(listbean.getList());
        } else {
            if (list == null)
                list = new ArrayList<StockListData>();
            list.addAll(listbean.getList());
        }
        setListBeanData(listbean);
    }

    @JSONField(serialize = false)
    public ArrayList<StockListData> getSelectedList(){
        ArrayList<StockListData> dataArrayList = new ArrayList<>();
        for(StockListData data : list){
            if(data.isSelect()){
                dataArrayList.add(data);
            }
        }
        return dataArrayList;
    }

}
